import request from "@/utils/request";


// 数据源列表 
export function dataSourceList(query) {
    return request({
        url: "/analysis/dataset/list",
        method: "get",
        params: query
    });
}

// 数据源列表-删除
export function dataSourceDelete(query) {
    return request({
        url: "/analysis/dataset/delete/" + query,
        method: "delete"
    });
}

//数据源列表-画板-左侧列表
export function drawingBoard(query) {
    return request({
        url: "/analysis/dataset/source/list",
        method: "get",
        params: query
    });
}

//数据源列表-画板-计算视图
export function calculateView (data){
  return request({
    url: '/analysis/dataset/previewData', // V1.1 接口
    method: 'post',
    data
  })
}

// 自定义上传excel

export function importExcelData (data){
    return request({
      url: '/analysis/dataset/importData', // V1.1 接口
      method: 'post',
      data
    })
}
//数据源列表-画板-查询指定数据源
export function drawingBoardSources(query) {
    return request({
        url: "/analysis/dataset/sources",
        method: "get",
        params: query
    });
}

// 下载excel模板
export function dowloadExcelModel (query){
    return request({
      url: 'common/download/oss', // V1.1 接口
      method: 'get',
      params: query
    })
}

//保存
export function calculateViewSave (query){
    return request({
      url: `/analysis/dataset/save/${query.id}`, // V1.1 接口
      method: 'post',
      data: query.requestDTO 
    })
}

//数据源-编辑
export function drawingBoardSourcesDetail(query) {
    return request({
        url: `/analysis/dataset/detail/${query}`,
        method: "get",
    });
}